<template>
  <div>
    <div class="collection">
      <img :src=classList.bannerFileUrl>
      <div class="mianRight">
        <p class="title">{{ classList.courseTitle }}</p>
        <span>累计{{ classList.participationsCount }}人学习</span>
        <p v-if="classList.isFree==='1'" class="free">免费</p>
        <div v-else id="money">
          <span>￥{{ classList.discountPrice }} </span>
          <span>￥{{ classList.coursePrice }}</span> <br>
          <span>{{classList.discountDesc}}</span>
        </div>
        <button class="collection">
          <i class="el-icon-star-off">收藏</i>
        </button>
        <button class="play">立即观看</button>
      </div>
    </div>
    <div class="collection">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="课程描述" name="first">
          <div v-html="classList.courseDetail"></div>
        </el-tab-pane>
        <el-tab-pane label="目录" name="second">目录</el-tab-pane>
        <el-tab-pane label="评论" name="third">评论</el-tab-pane>
      </el-tabs>
    </div>
  </div>

</template>

<script>
export default {
  name: "Collection"
}
</script>

<style scoped lang="less">
div.collection {
  overflow: hidden;
  padding: 20px;
  background-color: white;
  position: relative;
  margin-bottom: 20px;

  img {
    float: left;
    width: 330px;
    height: 220px;
    margin-right: 60px;
  }

  .mianRight {
    float: left;

    p.title {
      font-size: 24px;
    }

    span {
      color: #999999;
      font-size: 14px;
    }

    p.free {
      font-size: 24px;
      color: #00cf8c;
    }

    button.play {
      width: 160px;
      height: 45px;
      border: none;
      outline: none;
      color: white;
      background-color: #00cf8c;
      font-size: 18px;
      border-radius: 4px;
    }

    button.collection {
      width: 120px;
      height: 35px;
      border: 1px solid #999999;
      color: #999;
      font-size: 16px;
      background-color: white;
      outline: none;
      position: absolute;
      right: 30px;
      top: 42px;
    }

    button:hover {
      opacity: 0.8;
    }
  }
}
</style>